package com.jiazhong.cloud.example.student.school.controller;

import com.jiazhong.cloud.example.student.commons.bean.School;
import com.jiazhong.cloud.example.student.commons.util.JsonResult;
import com.jiazhong.cloud.example.student.school.service.SchoolService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/school")
public class SchoolController {
    @Resource
    private SchoolService schoolService;

    @PostMapping
    public JsonResult save(School school) {
        return schoolService.saveSchool(school);
    }

    @GetMapping("/find_id/{id}")
    public JsonResult findSchoolById(@PathVariable("id") String id) {
        return schoolService.findSchoolById(id);
    }
}
